<template>
    <div class="bar-chart-test">
        <h1>BarChart 简单测试</h1>

        <div class="test-section">
            <h2>基础柱状图</h2>
            <BarChart :data="testData" :series="testSeries" title="测试柱状图" :height="300" />
        </div>

        <div class="test-section">
            <h2>水平柱状图</h2>
            <BarChart :data="testData" :series="testSeries" title="水平柱状图" :height="300" direction="horizontal" />
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import BarChart from '@/components/charts/BarChart.vue'

// 测试数据 - 24小时访问量
const testData = ref([
    { name: '0:00', visits: 0 },
    { name: '1:00', visits: 0 },
    { name: '2:00', visits: 0 },
    { name: '3:00', visits: 0 },
    { name: '4:00', visits: 0 },
    { name: '5:00', visits: 0 },
    { name: '6:00', visits: 0 },
    { name: '7:00', visits: 0 },
    { name: '8:00', visits: 0 },
    { name: '9:00', visits: 0 },
    { name: '10:00', visits: 0 },
    { name: '11:00', visits: 0 },
    { name: '12:00', visits: 0 },
    { name: '13:00', visits: 0 },
    { name: '14:00', visits: 0 },
    { name: '15:00', visits: 1 },
    { name: '16:00', visits: 0 },
    { name: '17:00', visits: 0 },
    { name: '18:00', visits: 0 },
    { name: '19:00', visits: 0 },
    { name: '20:00', visits: 0 },
    { name: '21:00', visits: 2 },
    { name: '22:00', visits: 0 },
    { name: '23:00', visits: 0 }
])

// 测试系列配置
const testSeries = ref([
    { key: 'value', name: '访问量', color: '#409eff' }
])
</script>

<style scoped>
.bar-chart-test {
    padding: 20px;
    background: #f5f7fa;
    min-height: 100vh;
}

.test-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.test-section h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #409eff;
    padding-bottom: 8px;
}
</style>
